package processingdata.density;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class DensitySplitter {
	
	public static void main(String args[])throws IOException
	{
		BufferedReader inputReader=new BufferedReader(new FileReader(new File("project3cs424/density/popdensity.data")));
		int countLines=0;
		int index=0;
		while(inputReader.ready())
		{
			countLines++;
			BufferedWriter outputWriter=new BufferedWriter(new FileWriter(new File("project3cs424/density/density_split/density"+index),true));
			String inputLine=inputReader.readLine();
			outputWriter.write(inputLine+"\n");
			//String inputLineParts[]=inputLine.split("\t");
			if(countLines==1800)
			{
				index++;
				countLines=0;
			}
			outputWriter.close();
		}
	}

}
